package com.winning.joiner.magiccube.tool.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 读取代码生成相关配置
 * 
 * @author joiner
 */
@Component
@Scope("singleton")
 public class GenConfig implements Cloneable
{
    /** 作者 */
	@Value("${gen.author}")
    private  String author;
    /** 生成包路径 */
	@Value("${gen.packageName}")
	private  String packageName;
    /** 自动去除表前缀，默认是true */
	@Value("${gen.autoRemovePre}")
	private  String autoRemovePre;
    /** 表前缀(类名不会包含表前缀) */
	@Value("${gen.tablePrefix}")
	private  String tablePrefix;
	

	public  String getAuthor()
    {
        return author;
    }

    public void setAuthor(String author)
    {
        this.author = author;
    }

    public  String getPackageName()
    {
        return packageName;
    }

    public void setPackageName(String packageName)
    {
    	this.packageName = packageName;
    }

    public  String getAutoRemovePre()
    {
        return autoRemovePre;
    }

    public void setAutoRemovePre(String autoRemovePre)
    {
        this.autoRemovePre = autoRemovePre;
    }

    public  String getTablePrefix()
    {
        return tablePrefix;
    }

    public void setTablePrefix(String tablePrefix)
    {
        this.tablePrefix = tablePrefix;
    }

    @Override
    public String toString()
    {
        return "GenConfig [getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
                + "]";
    }
    
    @Override  
    public GenConfig clone() {  
    	GenConfig config = null;  
        try{  
            config = (GenConfig)super.clone();  
        }catch(CloneNotSupportedException e) {  
            e.printStackTrace();  
        }  
        return config;  
    }  

}
